package com.milk.controller.user;


import com.milk.entity.Category;
import com.milk.result.Result;
import com.milk.service.ICategoryService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/category")
@ApiModel(value = "奶茶分类")
public class CategoryController {
    @Autowired
    private ICategoryService categoryService;


    /**
     * 查询所有分类
     * @return
     */
    @GetMapping
    @ApiModelProperty("查询所有分类")
    public Result<List<Category>> selectAll(){

        List<Category> list = categoryService.selectALl();
        return Result.success(list);
    }

}
